package com.xdcplus.web.mapper.qa;

import com.xdcplus.mom.pojo.vo.SysBaseDataVO;
import com.xdcplus.mp.mapper.IBaseMapper;
import com.xdcplus.web.common.datasource.Doris;
import com.xdcplus.web.common.pojo.entity.qa.QaMtrlBatchReport;
import com.xdcplus.web.common.pojo.entity.qa.QaMtrlBatchReportAdverse;
import com.xdcplus.web.common.pojo.entity.qa.QaMtrlBatchReportScreen;
import com.xdcplus.web.common.pojo.vo.qa.*;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

/**
 * 质量结批报告(QaMtrlBatchReport)表数据库访问层
 *
 * @author Devin.Sang
 * @since 2024-01-24 11:44:30
 */
public interface QaMtrlBatchReportMapper extends IBaseMapper<QaMtrlBatchReport> {


    List<QaMtrlBatchReport> queryByCode(String reportCode);

    List<QaMtrlBatchReport> getUnPackMtrlNum(
            @Param("startTime")  Timestamp startTime,
            @Param("endTime") Timestamp endTime);

    @Doris
    List<OpenStartAndEndTimeVO> queryOpeStartAndEndTime(
            @Param("startTime") Timestamp startTime,
            @Param("endTime") Timestamp endTime,
            @Param("suppliedBatch") String suppliedBatch,
            @Param("planCode") String planCode);

    List<CrackSummaryVO> queryZrCrackSummary
            (@Param("zrOpeStartAndEndTime") OpenStartAndEndTimeVO zrOpeStartAndEndTime,
             @Param("ngNameList") List<String> ngNameList);

    @Doris
    List<IvSummaryVO> queryEtaGroupByLineNo(@Param("opeStartAndEndTime") OpenStartAndEndTimeVO opeStartAndEndTime,
                                            @Param("suppliedBatch") String suppliedBatch,
                                            @Param("planCode") String planCode);

    @Doris
    Long queryIvCount(@Param("opeStartAndEndTime") OpenStartAndEndTimeVO opeStartAndEndTime,
                      @Param("suppliedBatch") String suppliedBatch,
                      @Param("planCode") String planCode);

    @Doris
    Double queryEta(@Param("opeStartAndEndTime") OpenStartAndEndTimeVO opeStartAndEndTime,
                    @Param("suppliedBatch") String suppliedBatch,
                    @Param("eta") String eta,
                    @Param("planCode") String planCode);

    @Doris
    IvSummaryCountVO queryEtaCount(@Param("opeStartAndEndTime") OpenStartAndEndTimeVO opeStartAndEndTime,
                                   @Param("suppliedBatch") String suppliedBatch,
                                   @Param("eta") String eta,
                                   @Param("irev") String irev,
                                   @Param("rsh") String rsh,
                                   @Param("planCode") String planCode);

    Long queryUnPackPlanNum(@Param("planCode")String planCode);

    @Doris
    List<ElSummaryVO> queryElSummary(@Param("opeStartAndEndTime") OpenStartAndEndTimeVO opeStartAndEndTime,
                                     @Param("suppliedBatch") String suppliedBatch,
                                     @Param("planCode") String planCode);

    @Doris
    List<ElSummaryVO> querySeparatorSummary(
            @Param("opeType") int opeType,
            @Param("opeStartAndEndTime") OpenStartAndEndTimeVO opeStartAndEndTime,
            @Param("suppliedBatch") String suppliedBatch,
            @Param("planCode") String planCode);

    @Doris
    List<ElSummaryVO> queryZmColorSummary(
            @Param("opeType") int opeType,
            @Param("opeStartAndEndTime") OpenStartAndEndTimeVO opeStartAndEndTime,
            @Param("suppliedBatch") String suppliedBatch,
            @Param("planCode") String planCode);

    @Doris
    List<PackInfoVO> queryPackInfo(@Param("opeStartAndEndTime") OpenStartAndEndTimeVO opeStartAndEndTime,
                                   @Param("suppliedBatch") String suppliedBatch,
                                   @Param("planCode") String planCode);

    List<SysBaseDataVO> queryBaseConfig(@Param("dataCate") String ivPoorPerformance);

    @Doris
    List<ElSummaryVO> queryPackProduceOrderCDetail(@Param("opeStartAndEndTime") OpenStartAndEndTimeVO openStartAndEndTimeVO,
                                                    @Param("suppliedBatch") String suppliedBatch,
                                                    @Param("planCode") String planCode);

    List<String> queryReportCodesNotEnd(@Param("nowTime") Timestamp nowTime);


    List<OpenStartAndEndTimeVO> queryOpeStartAndEndTimeByCode(@Param("reportCode") String reportCode);


    List<QaMtrlBatchReportAdverse> queryQaMtrlBatchReportAdverseByCode(@Param("reportCode") String reportCode);


    List<QaMtrlBatchReportScreen> queryQaMtrlBatchReportScreenByCode(@Param("reportCode") String reportCode);


    List<CrackSummaryVO> queryCrackSummaryByCode(@Param("reportCode") String reportCode);


    List<IvSummaryVO> queryIvSummaryByCode(@Param("reportCode") String reportCode);


    List<ElSummaryVO> queryElSummaryByCode(@Param("reportCode") String reportCode, @Param("reportType") String reportType);


    List<PackInfoVO> queryPackInfoByCode(@Param("reportCode") String reportCode);

    List<IvSummaryCountVO> queryIvSummaryCountByCode(@Param("reportCode") String reportCode);


    List<OpePathVO> queryOpePath();


    void updateIvCount(@Param("rEta") String rEta, @Param("reportCode") String reportCode);

}
